﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Niknak.Services.TaskScheduler.Interfaces.DataModel
{
    public interface IAuditLog<AuditLogEntryType> where AuditLogEntryType : IAuditLogEntry
    {
        string EditPageUrl { get; }

        Guid AuditLogId { get; set; }
        Guid ScheduledTaskId { get; set; }
        DateTime StartDate { get; set; }
        DateTime FinishDate { get; set; }
        DateTime IterationDate { get; set; }
        Enums.TaskOutcome TaskOutcome { get; set; }
        Enums.CompletedEventStatus CompletedEventStatus { get; set; }
        AuditLogEntryType[] AuditLogEntries { get; set; }

        /// <summary>
        /// Not persisted!
        /// </summary>
        bool EnableLogging { get; set; }

        IAuditLog<AuditLogEntryType> GetAuditLogById(Guid auditLogId);
        IEnumerable<IAuditLog<AuditLogEntryType>> GetAuditLogsByScheduledTaskId(Guid scheduledTaskId);
        IEnumerable<IAuditLog<AuditLogEntryType>> GetAllAuditLogs();
        void SaveAuditLog();
        void AddEntry(Enums.AuditLogEntryType type, string message);
    }
}
